﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Automobile.service.BLL;
using Automobile.service.Model;
namespace Automobile.service.UI
{
    public partial class SupplierAdd : System.Web.UI.Page
    {
        SupplierBLL bll = new SupplierBLL();
        protected void Page_Load(object sender, EventArgs e)
        {

        }
         protected void btnUpt_Click(object sender, EventArgs e)
         {
             Supplier sur = new Supplier();
             sur.Supplier_Addr = this.Supplier_Addr.Text;
             sur.Supplier_Name = this.Supplier_Name.Text;
             sur.Supplier_People = this.Supplier_People.Text;
             sur.Supplier_Phone = this.Supplier_Phone.Text;
             if(bll.AddSupplier(sur)>0)
             {
                 Response.Write("<script>alert('添加成功');parent.layer.close(parent.layer.getFrameIndex(window.name));</script>");
               
             }
             else
             {
                 Response.Write("<script>alert('添加失败')</script>");
             }
         }

         protected void btnBack_Click(object sender, EventArgs e)
         {
             Response.Redirect("Index.aspx");
         }
    }
}